package com.lucian.ge.service.shop.impl;

import com.lucian.ge.dao.shop.PartnerMapper;
import com.lucian.ge.service.shop.PartnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by Lucicol on 2019/8/14.
 */
@Service("PartnerService")
public class PartnerServiceImpl implements PartnerService {

    @Autowired(required=false)
    private PartnerMapper partnerMapper;

    @Override
    public List<Map<String, String>> selectIncome(Integer userId) {
        return partnerMapper.selectIncome(userId);
    }

    @Override
    public List<Map<String, String>> selectRecharge(Integer userId) {
        return partnerMapper.selectRecharge(userId);
    }

    @Override
    public List<Map<String, String>> selectProfit(Integer userId) {
        return partnerMapper.selectProfit(userId);
    }

    //查询是否有合伙人这个ID
    @Override
    public String selectUserId(Integer userId) {
        return partnerMapper.selectUserId(userId);
    }

    //添加合伙人信息
    @Override
    public void insertUserId(Integer userId, String mingzi, String shouji, String weixin, String shenfenzheng) {
        partnerMapper.insertUserId(userId, mingzi, shouji, weixin, shenfenzheng);
    }

    //查询可提现余额
    @Override
    public String selectYuE(Integer userId) {
        return partnerMapper.selectYuE(userId);
    }

    //申请提现
    @Override
    public void insertTiXian(Integer userId,String tixianjine,String name, String tixianhao) {
//        System.out.println("11111111");
        partnerMapper.insertTiXian(userId,tixianjine, name,tixianhao);
    }

    //查询已结算余额
    @Override
    public String selectJieSuan(Integer userId) {
        return partnerMapper.selectJieSuan(userId);
    }

    //查询订单,客户付款金额,佣金
    @Override
    public List<Map<String, String>> selectDinDan(Integer userId,Integer timerang) {
        return partnerMapper.selectDinDan(userId, timerang);
    }

    //查询提现记录
    @Override
    public List<Map<String, String>> drawRecords(Integer userId) {
        return partnerMapper.drawRecords(userId);
    }

    //查询下级收益信息
    @Override
    public List<Map<String, String>> selectXiaJiShouYi(Integer userId, Integer timerang) {
        return partnerMapper.selectXiaJiShouYi(userId, timerang);
    }
}